// import { SetToken } from "../utils/global/functions";
import { setStorage } from "@/utils/storage";
const mutations = {
  // 设置用户信息
  setUserinfo: (state,value) => {
    state.userInfo = value;
    // console.log(value)
    setStorage("userInfo",value); // 保存用户信息到本地缓存
  },
  // 设置用户token
  set_usertoken: (state,value) => {
    state.token = value;
    // console.log(value)
    setStorage("token",value); // 保存用户信息到本地缓存
  },
  
 // 设置用户店铺选择条件
 setuserSelect: (state,value) => {
  state.vuexqueryForm = value;
  // console.log("用户选择条件",value)
  setStorage("vuexqueryForm",value); // 保存用户信息到本地缓存
},
// 设置用户项目选择条件
setuserengineerSelect: (state,value) => {
  state.vuexEngineerForm = value;
  // console.log("用户选择条件",value)
  setStorage("vuexEngineerForm",value); // 保存用户信息到本地缓存
},
// 退出登陆
clear_userInfo: (state) => {
  state.userInfo = {};
  var userInfo ={}
  setStorage("userInfo",userInfo)
},
// 设置返回上一级路由指向
saveRouterMode: (state,value) => {
  state.turnOpen = value;
  // console.log(value)
  setStorage("turnOpen",value); // 保存用户信息到本地缓存
},
}
export default mutations;